<?php
function pluginsLoad()
{
    global $plugins;
    if ($handle = opendir('./plugins/')) {
        while ($handle and (false !== ($file = readdir($handle)))) {
            if (substr($file,-4) == '.php') {
                include('./plugins/'.$file);
            }
        }
        if($handle) closedir($handle);
    }
}

function pluginSelect($url)
{
    global $plugins;
    foreach($plugins as $plugin){
        if (preg_match($plugin[1],$url)){
            return $plugin[0];
        }
    }
    return 'default';
}
?>